import java.util.*;

public class Test {
    // 将 偶数进行k次÷2，求得到的最小值
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            int k = in.nextInt();
            int[] a=new int[n];
            int[] b=new int[n];
            // 创建大根堆
            PriorityQueue<Integer> priorityQueue=new PriorityQueue<>(new Comparator<Integer>() {
                @Override
                public int compare(Integer o1, Integer o2) {
                    return o2-o1;
                }
            });
            for(int i=0;i<n;i++){
                a[i]=in.nextInt();
                priorityQueue.add(a[i]);
            }
            int j=0;
            int sum=0;
            while(k>0){
                int peek=priorityQueue.poll();
                if(peek%2 == 0){
                    int pop=peek/2;
                    priorityQueue.add(pop);
                    k--;
                }else{
                    b[j++]=peek;
                }

            }
            while(j>0){
                sum+=b[--j];

            }
            while(!priorityQueue.isEmpty()){
                sum+= priorityQueue.poll();
            }
            System.out.println(sum);
        }
    }





    // 找最小值区间
    public static void main202(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            int r = in.nextInt();
            int[] a=new int[n];
            PriorityQueue<Integer> priorityQueue=new PriorityQueue<>();
            int sum=0;
            int j=0;
            int k=0;
            for(int i=0;i<n;i++){
                a[i]=in.nextInt();
                if(sum < r){
                    sum+=a[i];
                    priorityQueue.add(a[i]);
                    k++;
                }else{
                        while(sum - priorityQueue.peek() >= r) {
                            sum -= priorityQueue.peek();
                            priorityQueue.poll();
                            j++;

                        }
                        if(j+ priorityQueue.size() != i){
                            continue;
                        } else{
                            if(priorityQueue.peek() > a[i] && sum- priorityQueue.peek()+a[i]>=r) {
                            sum = sum - priorityQueue.peek() + a[i];
                            priorityQueue.poll();
                            priorityQueue.add(a[i]);
                            j++;
                            }
                        }
                    }
                }
            System.out.print(j+" "+( j+ priorityQueue.size()-1));
            }

        }








    public static void main201(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextInt()) {
            int n = in.nextInt();
            int r = in.nextInt();
            int[] a=new int[n];
            for(int i=0;i<n;i++){
                a[i]=in.nextInt();
            }
            int sum=0;
            int j=0;
            int k=0;
            Queue<Integer> queue=new LinkedList<>();
            for(int i=0;i<n;i++){
                if(sum>=r){
                    break;
                }
                // 队列添加元素 ，sum计总和
                queue.add(a[i]);
                sum+=a[i];
                while(sum>r) {
                    int num = queue.peek();
                    if (sum - num >= r) {
                        queue.poll();
                        j++;
                        sum -= num;
                    } else {
                        while(queue.peek() > a[i+1] && sum- queue.peek()+a[i+1]>=r){
                            sum=sum- queue.peek()+a[i+1];
                            queue.poll();
                            queue.add(a[i+1]);
                            j++;
                            i++;
                    }
                        break;
                    }
                }



            }
            System.out.print(j+" "+( j+ queue.size()-1));


        }
    }







    // 字母简写
    public static void main01(String[] args) {

        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNext()) { // 注意 while 处理多个 case
            String str = in.nextLine();
            // 先换算成大写
            String s=str.toUpperCase();

            Stack<Character> stack=new Stack<>();

            // 先全部存进去
            for(int i=0;i<s.length();i++){
                stack.add(s.charAt(i));
            }
            int n=stack.size();
            char[] chars=new char[n];
            int count=0;
            for(int j=0;j<n;j++){
                char k=stack.pop();
                if(stack.isEmpty()){
                    chars[count++]=k;
                    break;
                }
                char m=stack.peek();
                if(m==' '){
                    chars[count++]=k;
                }
            }
            for(int l=count-1;l>=0;l--){
                System.out.print(chars[l]);
            }

    }
}
}
